<!DOCTYPE html>
<html>
<head>
    <title>清除认证信息</title>
</head>
<body>
    <h1>清除认证信息</h1>
    <button onclick="clearAuth()">清除所有认证信息</button>
    <div id="result"></div>

    <script>
        function clearAuth() {
            // 清除所有cookies
            document.cookie.split(";").forEach(function(c) { 
                document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); 
            });
            
            // 清除localStorage
            localStorage.clear();
            
            // 清除sessionStorage
            sessionStorage.clear();
            
            document.getElementById('result').innerHTML = '<p style="color: green;">认证信息已清除！请刷新页面或重新访问应用。</p>';
            
            // 2秒后自动跳转到主页
            setTimeout(() => {
                window.location.href = 'http://localhost:9529/';
            }, 2000);
        }
    </script>
</body>
</html>